#!perl -w
use strict;
use Mac::Glue;
use Mac::Files;
use Mac::InternetConfig;

my $file = FindFolder(kOnSystemDisk, kDesktopFolderType)
    . ":Mac-Glue-docs.html";
die "'$file' already exists.\n" if -e $file;
my $map  = $InternetConfigMap{$file};

my $url = new Mac::Glue 'URL_Access_Scripting';
$url->activate;
$url->download(
    'http://pudge.net/macperl/Mac-Glue-docs.html',
    to => $file, progress => 1
);
$url->quit;

if ($map && ref $map && $map->file_creator && $map->file_type) {
    MacPerl::SetFileInfo($map->file_creator, $map->file_type, $file);
}
